<?php namespace App\Models\Cxhshop;

use App\Models\Base\CxhshopBase;
use Illuminate\Support\Facades\DB;
/**
 * 银行卡总表
 */
class Bank extends CxhshopBase {

    protected $table = 'ims_cxh_bank';

    protected $fillable = [];

    protected $dates = [];

    public static $rules = [
        // Validation rules
    ];
    //根据用户id获取银行卡列表
    public function getBankInfoById($bId){
        $query = self::query();
        $bankInfo = $query -> where("id",$bId) ->first() -> toArray();
        return $bankInfo;
    }

    /**
     * 获取所有银行卡种类
     * @return array
     */
    public function getList(){
        $list = self::query() -> get(['id','bank','background_url','logo_url']);
        if($list){
            $data = $list -> toArray();
        }else{
            $data = [];
        }
        return $data;
    }




}